﻿using System.Data;
using System.ServiceModel;
using Microsoft.Synchronization.Data;

namespace SyncComm.Service
{
    [XmlSerializerFormat]
    [ServiceContract(Namespace = "urn:synccomm.com/2009/07/")]
    public interface ISyncService
    {

        /// <summary>
        /// Echoes the specified value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        [OperationContract]
        //[FaultContract(typeof(FaultDetail))]
        string Echo(string value);

        /// <summary>
        /// Gets the server info.
        /// </summary>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        [OperationContract]
        //[FaultContract(typeof(FaultDetail))]
        SyncServerInfo GetServerInfo(SyncSession syncSession);

        /// <summary>
        /// Applies the changes.
        /// </summary>
        /// <param name="groupMetadata">The group metadata.</param>
        /// <param name="dataSet">The data set.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        [OperationContract]
        //[FaultContract(typeof(FaultDetail))]
        SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, DataSet dataSet, SyncSession syncSession);

        /// <summary>
        /// Gets the changes.
        /// </summary>
        /// <param name="groupMetadata">The group metadata.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        [OperationContract]
        //[FaultContract(typeof(FaultDetail))]
        SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession);

        /// <summary>
        /// Gets the schema.
        /// </summary>
        /// <param name="tableNames">The table names.</param>
        /// <param name="syncSession">The sync session.</param>
        /// <returns></returns>
        [OperationContract]
        //[FaultContract(typeof(FaultDetail))]
        SyncSchema GetSchema(string[] tableNames, SyncSession syncSession); 

    }
       
}
